<!doctype html>
<html lang="`en`">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<div id="app">
    <h3>单选框</h3>
    <input id="male" type="radio" value="1" v-model="gender"> <label for="male">男</label>
    <input id="female" type="radio" value="0" v-model="gender"> <label for="female">女</label>
    <input id="baomi" type="radio" value="2" v-model="gender"> <label for="baomi">保密</label>
    <p>你的兴趣爱好是：{{gender}}</p>

    <h3>单选框2</h3>
    <input id="male1" type="radio" :value="generobj[0]" v-model="gender"> <label for="male1">男</label>
    <input id="female1" type="radio" :value="generobj[1]" v-model="gender"> <label for="female1">女</label>
    <input id="baomi1" type="radio" :value="generobj[2]" v-model="gender"> <label for="baomi1">保密</label>
    <p>你的兴趣爱好是：{{gender}}</p>
</div>

<script src="js/vue.global.js"></script>
<script>
    var vm = Vue.createApp({
        data() {
            return {
                gender:"",
                generobj:[{male:1,name:"男"},{male:0,name:"女"},{male:2,name:"保密"}]
            }
        }
    }).mount("#app");
</script>

</body>
</html>